﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Decoration.Models.Models
{
    public class DecorationDbContext:DbContext
    {
        public DecorationDbContext()
        {

        }

        public DecorationDbContext(DbContextOptions<DecorationDbContext> options)
            : base(options)
        {

        }

        //protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        //{
        //    if (!optionsBuilder.IsConfigured)
        //    {
        //        // 此处数据库名称决定了生成的数据库的名称
        //        optionsBuilder.UseSqlServer("Data Source=.;Initial Catalog=DecorationDB;user id=sa;password=123456;Max Pool Size=512;Min Pool Size=5");
        //    }
        //}

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            ///添加种子数据
            modelBuilder.Seed();

            base.OnModelCreating(modelBuilder);
        }

        // 实体集 - 数据表
        //public virtual DbSet<BookInfo> Books { get; set; }
        public virtual DbSet<Base_DictType> Base_DictTypes { get; set; }
        public virtual DbSet<Base_DictInfo> Base_DictInfos { get; set; }
        public virtual DbSet<Base_UserInfo> Base_UserInfos { get; set; }
        public virtual DbSet<Base_LoginInfo> Base_LoginInfos { get; set; }
        public virtual DbSet<Base_MenuInfo> Base_MenuInfos { get; set; }
        public virtual DbSet<Base_RoleInfo> Base_RoleInfos { get; set; }
        public virtual DbSet<Base_RoleMenu> Base_RoleMenus { get; set; }
        public virtual DbSet<Base_UserRole> Base_UserRoles { get; set; }

        public virtual DbSet<BusinessInfo> BusinessInfos { get; set; }
        public virtual DbSet<ProcedureInfo> ProcedureInfos { get; set; }

        public virtual DbSet<ProjectInfo> ProjectInfos { get; set; }
        public virtual DbSet<UserProcedure> UserProcedures { get; set; }
        public virtual DbSet<UserProcedureRecord> UserProcedureRecords { get; set; }
        public virtual DbSet<OrderInfo> OrderInfos { get; set; }
        public virtual DbSet<OrderDetail> OrderDetails { get; set; }

        public virtual DbSet<ProductInfo> ProductInfos { get; set; }
        public virtual DbSet<CustomerInfo> CustomerInfos { get; set; }

        public virtual DbSet<WF_Node> WF_Nodes { get; set; }
        public virtual DbSet<WF_Record> WF_Records { get; set; }
        public virtual DbSet<WF_Instance> WF_Instances { get; set; }
        public virtual DbSet<WF_ApprovalFlow>WF_ApprovalFlows { get; set; }

        public virtual DbSet<DelayInfo> DelayInfos { get; set; }
        public virtual DbSet<TransferInfo> TransferInfos { get; set; }

    }
}
